import myAxios from './http';
// 作业提交主页的api

// 任务内容
function getTask(params) {
  return myAxios({
    url: '/work_manager/',
    method: 'get',
    data: params,
    type: 'formData',
  });
}
// 传递ID
function passID(params) {
    if(params!==0&&!params){return new Promise(function(res,req){})}
  return myAxios({
    url: '/student/' + params,
    method: 'get',
    data: params,
  });
}
// 上传文件
function uploadFile(params){
  return myAxios({
    url: '/work_list/submit',
    method: 'post',
    type: 'formData',
    data: params,
    loading:true,
  },{
    text: "作业正在上传中请稍后..."
  });
}
function getWorkRecent(params){
    return myAxios({
    url: '/work_manager/recent',
    method: 'post',
    data: params,
  });
}
export default {
  // 在这里导出所有函数
  getTask,
  passID,
  uploadFile,
getWorkRecent
};
